package com.appspot.moviesessions;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.Spinner;

public class MovieSessionActivity extends FragmentActivity implements
		MovieSessionView {

	private MovieSessionPresenter presenter;

	public MovieSessionActivity() {

	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.movie_session);
		AndroidFactory androidFactory = AndroidFactory.getInstance();
		this.presenter = new MovieSessionPresenter(this, new LoaderFactoryImpl(
				this, androidFactory, new ViewBinderFactoryImpl(
						getContentResolver(), androidFactory, androidFactory),
				androidFactory, androidFactory), androidFactory);
	}

	@Override
	protected void onStart() {
		super.onStart();
		presenter.onStart();
	}

	@Override
	public Spinner getMovieSpinner() {
		return (Spinner) findViewById(R.id.spnMovies);
	}

	@Override
	public Spinner getLocationSpinner() {
		return (Spinner) findViewById(R.id.spnLocation);
	}

}
